package com.yff.system.dubbo;

import com.alibaba.fastjson.JSONObject;
import com.yff.system.dubbo.api.GreetingProviderService;
import com.yff.system.dubbo.api.dto.TestDTO;
import com.yff.system.dubbo.api.vo.TestVO;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@DubboService
@Component
public class GreetingProviderServiceImpl implements GreetingProviderService {

    protected final Logger logger = LoggerFactory.getLogger(this.getClass());


    @Override
    public TestVO testRpc(TestDTO testDTO) {
        logger.info("这是provider服务，传过来的参数:" + JSONObject.toJSONString(testDTO));
        TestVO testVO = new TestVO();
        testVO.setId(testDTO.getId());
        return testVO;
    }
}
